Conversation
Kevin-P-Kerr
left a comment
There was a problem hiding this comment.
My only concern is that FixedIntegerList can only represent (I believe) 8 bit values. That works for this use case?
|
@Kevin-P-Kerr yes, the gpp state specs only represent values 0,1,2 as the values (e.g. SensitiveDataProcessing , KnownChildSensitiveDataConsents). theoretically it could have been packed even smaller, but i found byte the smallest primitive which has built-in casts to/from int. |
| public int setInt(int index, int value) { | ||
| // NOTE: int 128 is prevented since it would get turned into byte -128 | ||
| if(value < 0 || value >= 128) { | ||
| throw new IllegalArgumentException("FixedIntegerList only supports positive integers less than 128."); |
There was a problem hiding this comment.
this should be fine as the most typical values are 0,1,2 I believe
…nto 4.X-compact-fixed-int-list
|
the most recent changes:
15x faster, 70% reduction in memory usage versus the 4.X branch. this was my final round of optimizations. at this point, i consider this work completed. once this is merged in, i will port the changes from master into the 4.X branch. |
i have tried the 4.X branch out in a real production environment under real load. this allowed me to profile and kill off more hotspots. here are the main changes:
FixedIntegerListinstead ofList<Integer>. that FixedIntegerList is much more optimized: store in a byte array, add methods for unboxed access.